package charpter11.lynx;

import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Random;

public class Fourteen {
	public static void main(String[] args){
		LinkedList<Integer> test = new LinkedList<Integer>();
		Random rd = new Random(48);
		
		for (int i = 0;i < 10; i++){
			test.add(rd.nextInt(100));
		}
		
		System.out.println(test);
		
		ListIterator<Integer> it = test.listIterator();
		while (it.next() != test.get((test.size() - 1)/2));//找到中间
		
		for(int i =0; i < 5; i++){
			it.add(rd.nextInt(100));
		}
		
		System.out.println(test);
	}
}
